package com.zoe.onelink.mybatis.interceptor.impl;


import com.zoe.onelink.common.entity.IBaseEntity;
import com.zoe.onelink.mybatis.interceptor.MybatisEntityUpdateInterceptor;
import com.zoe.onelink.mybatis.interceptor.PreUpdate;

/**
 * <p>标题: </p>
 * <p>描述: </p>
 * <p>版权: Copyright (c) 2021</p>
 * <p>公司: 智业软件股份有限公司</p>
 *
 * @version: 1.0
 * @author: ruansheng
 * @date: 2021-03-23
 */
public class MybatisPreUpdateUpdateInterceptor implements MybatisEntityUpdateInterceptor {

    @Override
    public void onUpdate(IBaseEntity entity) {
        if (entity instanceof PreUpdate) {
            ((PreUpdate) entity).onInsertOrUpdate();
        }
    }
}
